MESSAGE(STATUS "Library: op_vector")

INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/src/op_vector
${CMAKE_SOURCE_DIR}/thirdparty/mpich2_install/include
)

LINK_DIRECTORIES(
${CMAKE_SOURCE_DIR}/thirdparty/mpich2_install/lib
${CMAKE_SOURCE_DIR}/thirdparty/lapack_lib
)

SET(LIBS
mpich
mpl
lapack
blas
rt
pthread
)

SET(CMAKE_CXX_COMPILER mpic++)
SET(CMAKE_C_COMPILER mpicc)

FILE(GLOB_RECURSE src_list "*.c")

IF(with_64bit)
    SET(lib_name "op_vector64")
    SET(defined_macro "-DPETSC_USE_64BIT_INDICES")
ELSE(with_64bit)
    SET(lib_name "op_vector")
    SET(defined_macro "")
ENDIF(with_64bit)

########## cmake script for lr_train ###########
#uncomment the line to generate coverage report
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -O2 -ftest-coverage -fprofile-arcs")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -O2")

SET(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/lib)
ADD_LIBRARY(${lib_name} STATIC ${src_list})
TARGET_LINK_LIBRARIES(${lib_name} ${LIBS})
ADD_DEFINITIONS(-DINTERLACING -DBLOCKING ${defined_macro})


